package com.xyy.saas.payment.adpater.jd.utils;

import java.net.InetAddress;

public class JDIPUtil {

    /**
     * 获取本机IP
     *
     * @return 本机IP，获取异常时返回127.0.0.1
     */
    public static String getLocalIP() {
        try {
            InetAddress address = InetAddress.getLocalHost();
            String localIp = address.getHostAddress();
            return localIp;
        } catch (Exception e) {
            return "127.0.0.1";
        }
    }
}
